home *** CD-ROM | disk | FTP | other *** search
/ Internet Professionell Archive 1999 / Ipro_0200.iso / SELFHTML / ykoepfe.dcr / 00001_Main Movie Script.ls next >
Encoding:
Text File  |  1998-04-27  |  1.6 KB  |  62 lines

  1. global cSizeList, cBound, gReleaseTime, gSkullObjList, gTrackingList, gMouseH, gMouseV, gReleaseAtTime
  2.  
  3. on startMovie
  4.   set the cpuHogTicks to the maxinteger
  5.   set the randomSeed to the ticks
  6.   preLoadCast(61, 84)
  7.   set gMouseH to the mouseH
  8.   set gMouseV to the mouseV
  9.   setConstants()
  10.   setGlobals()
  11.   liberateSkull(getAt(gSkullObjList, 1))
  12. end
  13.  
  14. on setConstants
  15.   set cSizeList to [#t, #s, #m, #L]
  16.   set baseCastNum to the number of cast "Movie PICT 10"
  17.   set baseWidth to the width of cast baseCastNum / 2
  18.   set baseHeight to the height of cast baseCastNum / 2
  19.   set cBound to rect(baseWidth, baseHeight, 464 - baseWidth, 320 - baseHeight)
  20. end
  21.  
  22. on setGlobals
  23.   set gSkullObjList to []
  24.   repeat with x = 1 to 5
  25.     add(gSkullObjList, birth(script "Skulls Parent Script", x))
  26.     puppetSprite(x, 1)
  27.   end repeat
  28.   set gReleaseTime to the ticks
  29.   set gTrackingList to [1, 0, 0, 0, 0]
  30.   set gReleaseAtTime to 500
  31. end
  32.  
  33. on animateSkulls
  34.   repeat with t = 1 to count(gSkullObjList)
  35.     animateSkull(getAt(gSkullObjList, t))
  36.   end repeat
  37.   if (the ticks - gReleaseTime) > gReleaseAtTime then
  38.     repeat with x = 1 to count(gTrackingList)
  39.       set spriteToTry to x
  40.       set whichUn to getAt(gTrackingList, spriteToTry)
  41.       if not whichUn then
  42.         liberateSkull(getAt(gSkullObjList, spriteToTry))
  43.         exit repeat
  44.       end if
  45.     end repeat
  46.     set gReleaseTime to the ticks
  47.   end if
  48. end
  49.  
  50. on waitfor seconds
  51.   set now to the timer
  52.   repeat while the timer < (now + (seconds * 60))
  53.     if the mouseDown then
  54.       exit
  55.     end if
  56.   end repeat
  57. end
  58.  
  59. on randomInRange low, high
  60.   return low + random(high - low + 1) - 1
  61. end
  62.